$(document).ready(
	function() {
		
		$('#my_details_save_button').bind('click', function() {
			var oParams = {
				sUserFirstName : $('#user_fname').val(),
				sUserLastName : $('#user_lname').val(),
				sUserEmail : $('#user_email').val(),
				sUserPasswd : $('#user_passwd').val(),
				sUserPasswdChk : $('#user_passwd_chk').val()
			};
			
			
			if (oParams.sUserFirstName === '') {
				$.prompt('Please enter a first name');
				return;
			}
			
			if (oParams.sUserLastName === '') {
				$.prompt('Please enter a last name');
				return;
			}
			
			if (oParams.sUserEmail === '') {
				$.prompt('Please enter an email address');
				return;
			}
			
			
			$.post('/admin/my_details/ajax/save_my_details', oParams, function(data) {
				$.prompt(data.sContent);
			}, 'json');
				
			
			
		});
			
	}
);